package com.xianyu.open.restclient.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 *
 * @author bailinan
 * @date 2018/7/22
 */
@Component
@ConfigurationProperties(prefix = "xianyu.restClient")
public class RestClientProperties {

    private int connectTimeout = 5000;
    private int readTimeout = 5000;

    public int getConnectTimeout() {
        return connectTimeout;
    }

    public void setConnectTimeout(int connectTimeout) {
        if (connectTimeout <= 0) {
            return;
        }
        this.connectTimeout = connectTimeout;
    }

    public int getReadTimeout() {
        return readTimeout;
    }

    public void setReadTimeout(int readTimeout) {
        if (readTimeout <= 0){
            return;
        }
        this.readTimeout = readTimeout;
    }

}
